# 评论
class Comment < ApplicationRecord
  validates :content, presence: {message: "评论内容不能为空"}
  validates :user_id, presence: {message: "用户不能为空"}
  validates :blog_id, presence: {message: "博客不能为空"}
  # 评论属于一个用户
  belongs_to :user
  # 评论属于一个博客
  belongs_to :blog
end
